<?php
/**
 * Created by PhpStorm.
 * User: 18048
 * Date: 2018/5/14
 * Time: 14:57
 */
$serv = new swoole_server('0.0.0.0','9501');

$serv->set(array(
    'reactor_num'=>1,
    'worker_num'=>2,
));
//添加监听端口
$serv->addListener('0.0.0.0',9502,SWOOLE_SOCK_TCP);
$serv->addListener('0.0.0.0',9503,SWOOLE_SOCK_UDP);

$serv->on('connect',function($serv,$fd){});
$serv->on('receive',function($serv,$fd,$from_id,$data){});
$serv->on('close',function($serv,$fd){});

$serv->start();
